# Scrapy settings for JDShoePro project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
#     https://docs.scrapy.org/en/latest/topics/settings.html
#     https://docs.scrapy.org/en/latest/topics/downloader-middleware.html
#     https://docs.scrapy.org/en/latest/topics/spider-middleware.html

BOT_NAME = "JDShoePro"

SPIDER_MODULES = ["JDShoePro.spiders"]
NEWSPIDER_MODULE = "JDShoePro.spiders"

# 只显示error错误
# LOG_LEVEL = 'ERROR'

# Crawl responsibly by identifying yourself (and your website) on the user-agent
#USER_AGENT = "JDShoePro (+http://www.yourdomain.com)"

# Obey robots.txt rules
# ROBOTSTXT_OBEY = True
ROBOTSTXT_OBEY = False

# Configure maximum concurrent requests performed by Scrapy (default: 16)
#CONCURRENT_REQUESTS = 32

# Configure a delay for requests for the same website (default: 0)
# See https://docs.scrapy.org/en/latest/topics/settings.html#download-delay
# See also autothrottle settings and docs
#DOWNLOAD_DELAY = 3
# The download delay setting will honor only one of:
#CONCURRENT_REQUESTS_PER_DOMAIN = 16
#CONCURRENT_REQUESTS_PER_IP = 16

# Disable cookies (enabled by default)
#COOKIES_ENABLED = False
# 启动默认cookie
COOKIES_ENABLED = True
COOKIES_DEBUG = True
COOKIES = {
    'cookie': "__jdv=122270672%7Cdirect%7C-%7Cnone%7C-%7C1722995366529; mba_muid=17229953665291713360173; __jdu=17229953665291713360173; _pst=jd_dmePReZWCFLg; logintype=qq; unick=jd_cu8ie4413byv8u; pin=jd_dmePReZWCFLg; npin=jd_dmePReZWCFLg; thor=FC6D9FB2649743706F773CF4CAA6AACDB022916004D84720F0FB9C30BA56B53507771855C701CA0A6675C740E4A958EC28F488537B6719F2CC2B633C883BEF52EBDB4A83A42DB21B0EDA1D5CF72E0000AD55460B81C88C5401777B699ACB3F4F348B37BC437C3885B84188FEBB5921C6EA277F63B5A9224FF18FC5229FBBE194A3741B1BC4333581EB2ADDF72B7A79A12AEDBCB367B5226E4D2E6D44E91757FE; _tp=xLd9fPFkHUc7%2BXtc6tnhUg%3D%3D; pinId=cpOdZEkT5txiLQu8BY__TQ; shshshfpa=3fa61193-7b11-8f43-a17f-04247f3e5ef9-1722995387; shshshfpx=3fa61193-7b11-8f43-a17f-04247f3e5ef9-1722995387; areaId=7; ipLoc-djd=7-454-457-35635; chat.jd.com=20170206; mt_xid=V2_52007VwMUUV5QWl4dTh5YBm8DFFJfWlVbH08bbFJkVEVRWwtTRhdOTAsZYlBCWkEIUlsZVRxfBDUGF1NbWlEJH3kaXQZiHxNbQVlUSx9JEl0GbAYXYl9oUmoWThhYDWYEFFNcWVRdHEoRXABuMxJUWVw%3D; mba_sid=17230334414527341115996185437.2; flash=3_go7OM5sS8hcXx3WL_1WnRlU7038eHutjrXnKWWp0DJYnhSbLUYK8p9NVQw48SvplYVDArMkRrMGlwU6VxIpsg5Zwu-4yzXUXuO2qrvPI5DlroGHkucVMETbmw9QBg4DPe2UmIPTuPdv2_aZSA-cIwnTIdz3YLGT5j1IWPSvyCq**; jsavif=1; avif=1; __jda=29846306.17229953665291713360173.1722995366.1723027511.1723033441.5; __jdc=29846306; jsavif=1; xapieid=jdd03UA5ROOT2HPFVDNEF22DQOUNQ2JC6YFB7WKLS7EX4LESNZYK5DJHNHA7YBPIGVLGUXGHMO6NSFVPPW4XKMJDCEAIA64AAAAMRFTF5VSQAAAAADTQU6QI5UDLL5QX; __jdb=29846306.7.17229953665291713360173|5.1723033441; 3AB9D23F7A4B3CSS=jdd03UA5ROOT2HPFVDNEF22DQOUNQ2JC6YFB7WKLS7EX4LESNZYK5DJHNHA7YBPIGVLGUXGHMO6NSFVPPW4XKMJDCEAIA64AAAAMRFTJIH7IAAAAAD7I66VTPLAZQLEX; _gia_d=1; shshshfpb=BApXSuhzaL_RAUL-DiVZh9xO2bVPE-O8jBmDYVKho9xJ1MgPpr4C2; 3AB9D23F7A4B3C9B=UA5ROOT2HPFVDNEF22DQOUNQ2JC6YFB7WKLS7EX4LESNZYK5DJHNHA7YBPIGVLGUXGHMO6NSFVPPW4XKMJDCEAIA64"

}

# Disable Telnet Console (enabled by default)
#TELNETCONSOLE_ENABLED = False

# Override the default request headers:
# 启动默认请求头
DEFAULT_REQUEST_HEADERS = {
    'User-Agent': "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36 Chrome 17.0 – MAC",
    "referer": "https://qq.jd.com/",

}


# Enable or disable spider middlewares
# See https://docs.scrapy.org/en/latest/topics/spider-middleware.html
# SPIDER_MIDDLEWARES = {
#    # "JDShoePro.middlewares.JdshoeproSpiderMiddleware": 543,
#    "JDShoePro.middlewares.MyCustomDownloaderMiddleware": 543,
# }

# Enable or disable downloader middlewares
# See https://docs.scrapy.org/en/latest/topics/downloader-middleware.html
# DOWNLOADER_MIDDLEWARES = {
#    # "JDShoePro.middlewares.JdshoeproDownloaderMiddleware": 543,
#    "JDShoePro.middlewares.JdshoeproDownloaderMiddleware": 543,
# }

# Enable or disable extensions
# See https://docs.scrapy.org/en/latest/topics/extensions.html
#EXTENSIONS = {
#    "scrapy.extensions.telnet.TelnetConsole": None,
#}

# Configure item pipelines
# See https://docs.scrapy.org/en/latest/topics/item-pipeline.html
ITEM_PIPELINES = {
   "JDShoePro.pipelines.JdshoeproPipeline": 299,
}

# Enable and configure the AutoThrottle extension (disabled by default)
# See https://docs.scrapy.org/en/latest/topics/autothrottle.html
#AUTOTHROTTLE_ENABLED = True
# The initial download delay
#AUTOTHROTTLE_START_DELAY = 5
# The maximum download delay to be set in case of high latencies
#AUTOTHROTTLE_MAX_DELAY = 60
# The average number of requests Scrapy should be sending in parallel to
# each remote server
#AUTOTHROTTLE_TARGET_CONCURRENCY = 1.0
# Enable showing throttling stats for every response received:
#AUTOTHROTTLE_DEBUG = False

# Enable and configure HTTP caching (disabled by default)
# See https://docs.scrapy.org/en/latest/topics/downloader-middleware.html#httpcache-middleware-settings
#HTTPCACHE_ENABLED = True
#HTTPCACHE_EXPIRATION_SECS = 0
#HTTPCACHE_DIR = "httpcache"
#HTTPCACHE_IGNORE_HTTP_CODES = []
#HTTPCACHE_STORAGE = "scrapy.extensions.httpcache.FilesystemCacheStorage"

# Set settings whose default value is deprecated to a future-proof value
REQUEST_FINGERPRINTER_IMPLEMENTATION = "2.7"
TWISTED_REACTOR = "twisted.internet.asyncioreactor.AsyncioSelectorReactor"
FEED_EXPORT_ENCODING = "utf-8"
